package com.biaobiaoqi.scoreanalysis.hibernate.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

import com.biaobiaoqi.scoreanalysis.util.Gender;

@Entity
public class Student extends BaseBean{
	@Column(nullable=false)
	private String name;
	@Column(nullable=false)
	private Gender gender;
	private Date birthday;
	@Column(unique=true, nullable=false)
	private Long studentNumber;
	@ManyToOne
	@JoinColumn(nullable=false)
	private Clazz belongClazz; 
	@ManyToMany(mappedBy="students")
	private List<Examination> examinations=new ArrayList<Examination>();

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Gender getGender() {
		return gender;
	}
	public void setGender(Gender gender) {
		this.gender = gender;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public Long getStudentNumber() {
		return studentNumber;
	}
	public void setStudentNumber(Long studentNumber) {
		this.studentNumber = studentNumber;
	}
	public Clazz getBelongClazz() {
		return belongClazz;
	}
	public void setBelongClazz(Clazz belongClazz) {
		this.belongClazz = belongClazz;
	}
	public List<Examination> getExaminations() {
		return examinations;
	}
	public void setExaminations(List<Examination> examinations) {
		this.examinations = examinations;
	}
	 
}
